﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace MaHoaUngDung
{
    public partial class VerifyDigiSigFrm : DevComponents.DotNetBar.Office2007Form
    {
        private string _strFile;
        private string _strSigFile;

        public string FilePath
        {
            get { return this._strFile; }
        }
        public string SigFilePath
        {
            get { return this._strSigFile; }
        }

        public VerifyDigiSigFrm()
        {
            InitializeComponent();
            _strFile = string.Empty;
            _strSigFile = string.Empty;
        }

        private void btnBrowseFile_Click(object sender, EventArgs e)
        {
            openFileDialog1.Filter = "Data file|*.*";
            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                txtFile.Text = openFileDialog1.FileName;
            }
        }

        private void btnBrowseSigFile_Click(object sender, EventArgs e)
        {
            openFileDialog1.Filter = "Signature file|*.sig";
            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                txtSigFile.Text = openFileDialog1.FileName;
            }
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            if (txtSigFile.Text.Equals(string.Empty))
            {
                MessageBox.Show("làm ơn nhập đường dẫn tập tin đã ký!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                return;
            }
            if (txtFile.Text.Equals(string.Empty))
            {
                MessageBox.Show("làm ơn nhập đường dẫn tập tin đã ký!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                return;
            }

            _strSigFile = txtSigFile.Text;
            _strFile = txtFile.Text;

            DialogResult = DialogResult.OK;
            this.Close();
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            DialogResult = DialogResult.Cancel;
            this.Close();
        }
    }
}
